This function divides a symbol or vector pattern into shorter chunks. Normally, the division is performed in equal basis, that is, to divide the whole pattern in equal chucks. There still exists a couple of extra controls making it possible to define both a chuck length pattern and a pattern that adds (or subtracts) offset on the starting division position. With the aid of flatten the operation is a relative to the gen-loop, but uses an algorithmic picking scheme.
Equal lengths
(symbol-divide 2 nil nil '(a b c d e f g))
--> ((a b) (c d) (e f) (g))
Length pattern
(symbol-divide '(2 3) nil nil '(a b c d e f g))
--> ((a b) (c d e) (f g))
Fixed length and offset pattern
(symbol-divide '(2 (-1 -2)) nil nil '(a b c d e f g) )
--> ((a b) (b c) (b c) (c d) (c d) (d e) (d e) (e f) (e f)
(f g) (f g) (g) (g))
Length and offset patterns
(symbol-divide '((2 3) (-1 -2)) nil nil '(a b c d e f g))